package com.nami.ucenter.controller.convertor;


import com.nami.transport.proto.codec.MqTransMsg;
import com.nami.transport.proto.codec.UpWsMsg;
import com.nami.ucenter.facade.login.request.command.UserLoginCmd;

public class WrapToLoginCmdAssembler {

    public static UserLoginCmd toUserLoginCommand(MqTransMsg.Gate2LogicLoginRequest login,
                                                  UpWsMsg.ConnectMsgBody msg) {

        UserLoginCmd command = new UserLoginCmd();
        command.setAppKey(msg.getAppKey());
        command.setUserId(msg.getUserId());
        command.setCurrTime(msg.getTimestamp());
        command.setToken(msg.getToken());
        command.setPlatform(msg.getPlatform());

        command.setInstanceId(msg.getInstanceId());
        command.setConnectId(login.getConnectId());
        command.setDubboIp(login.getDubboIp());
        command.setDubboPort(login.getDubboPort());
        command.setTempFingerprint(login.getTempFingerprint());
        command.setClientIp(login.getClientIp());
        return command;
    }


}
